package cn.kgc.utils;

import java.util.UUID;

public class UUIDUtils {

    public static String createUUID() {
        return createUUID(false);
    }
    public static String createUUID(boolean flag){
        if (flag){
            return UUID.randomUUID().toString().replace("-","");
        }
        return UUID.randomUUID().toString();
    }
    public static String createUUID(int length,boolean flag){
        if (flag){
            return UUID.randomUUID().toString().replace("-","").substring(0,length);
        }
        return UUID.randomUUID().toString().substring(0,length);
    }
}
